#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#define MAX_NUM 100

void ThreeSum(int nums[], int len)
{
    if (nums == NULL || len <= 2) {
        return;
    }
    // sort
    int i, j;
    for (i = 0; i < len - 1; i++) {
        for (j = i + 1; j < len; j++) {
            if (nums[i] > nums[j]) {
                // swap
                int tmp = nums[i];
                nums[i] = nums[j];
                nums[j] = tmp;
            }
        }
    }
    int sets[MAX_NUM][3] = {0}; // 3 is rows
    int index = 0;
    int k;
    for (i = 0; i < len - 2; i++) { // 2 is remains
        if (i > 0 && nums[i] == nums[i - 1]) {
            continue;
        }
        j = i + 1;
        k = len - 1;
        while (j < k) {
            int sum = nums[i] + nums[j] + nums[k];
            if (sum == 0) {
                //printf("%d %d %d\n", nums[i], nums[j], nums[k]);
                if (index < MAX_NUM) {
                    sets[index][0] = nums[i];
                    sets[index][1] = nums[j];
                    sets[index][2] = nums[k];   // 2 is index
                    index++;
                }
                j++;
                k--;
                while (j < k && nums[j] == nums[j - 1]) {
                    j++;
                }
                while (j < k && nums[k] == nums[k + 1]) {
                    k--;
                }
            } else if (sum < 0) {
                j++;   
            } else {
                k--;
            }
        }
    }
    for (i = index - 1; i >= 0; i--) {
        printf("%d %d %d\n", sets[i][0], sets[i][1], sets[i][2]);
    }
}


int main(void)
{
    // int nums[] = {-1, 0, 1, 2, -1, -4};
    // int len = sizeof(nums)/sizeof(int);
    // ThreeSum(nums, len);

    int num = 0;
    int nums[MAX_NUM] = {0};
    int index = 0;

    do {
        int ret = scanf("%d", &num);
        if (ret == EOF) {
            break;
        }
        if (index < MAX_NUM) {
            nums[index] = num;
            index++;
        } else {
            break;
        }
    } while (getchar() != '\n');

    ThreeSum(nums, index);

    return 0;
}
